package cn.edu.scau.cmi.wangjushen.multipleton;

import java.util.ArrayList;
import java.util.List;

public class Marshal {
	private static final int N = 10;
	private static List<Marshal> list = new ArrayList<Marshal>(N);
	private String name;
	
	private Marshal(String name) {
		this.name = name;
	}
	
	public static Marshal getInstance(String name) {
		if (list.size() < N) {
			Marshal marshal = new Marshal(name);
			list.add(marshal);
			return marshal;
		}
		else {
;			return null;
		}
	}
	
	public static List<Marshal> GetInstanceList() {
		return list;
	}

	public String getName() {
		return name;
	}
}
